package com.spring.boot.quarte.controller;

import com.spring.boot.quartz.QuartzApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Arrays;

/**
 * @author LiKun
 * @date 2021/7/31 10:16
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = QuartzApplication.class)
public class Knife {
    private String point = "/";
    @Resource
    private ApplicationContext applicationContext;

    @Test
    public void one() {
        applicationContext.getBeansWithAnnotation(RestController.class)
                .forEach((key, val) -> System.out.println("Key: " + key + ", val: " + val.getClass().getPackage()));
    }

    @Test
    public void two() {
        System.out.println(Arrays.toString("com.spring.boot.quartz.controller".split("[.]]")));
    }
}
